//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package come.tool.JDialog;

import com.tool.btn.BaptizeBtn;
import org.come.Frame.ZhuFrame;
import org.come.entity.Goodstable;
import org.come.mouslisten.GoodsMouslisten;
import org.come.until.AccessSuitMsgUntil;
import org.come.until.GoodsListFromServerUntil;
import org.come.until.Goodtype;
import org.come.until.Util;

public class ClearAllGoodJDialog implements TiShiChuLi {
    public ClearAllGoodJDialog() {
    }

    @Override
    public void tipBox(boolean tishi, Object object) {
        if (tishi) {
            this.clearAllBack();
        }

    }

    public void clearAllBack() {
        if (!Util.isCanBuyOrno()) {
            int page = GoodsListFromServerUntil.Pagenumber;

            for(int i = 0; i < 24; ++i) {
                Goodstable good = GoodsListFromServerUntil.getGoodslist()[i + page * 24];
                if (good != null) {
                    if (good.getGoodlock() == 1) {
                        ZhuFrame.getZhuJpanel().addPrompt("物品#G" + good.getGoodsname() + "#Y已加锁，不可丢弃");
                    } else if (Goodtype.EquipmentType(good.getType()) != -1 && AccessSuitMsgUntil.getExtra(good.getValue(), BaptizeBtn.Extras[4]) != null) {
                        ZhuFrame.getZhuJpanel().addPrompt2("物品#G" + good.getGoodsname() + "#Y已镶嵌宝石无法丢弃");
                    } else {
                        good.setUsetime(0);
                        GoodsMouslisten.gooduse(good, 1);
                        GoodsListFromServerUntil.Delete(i + page * 24);
                        GoodsMouslisten.goodreplace(-1, -1);
                    }
                }
            }

        }
    }
}
